<?php
namespace app\blog\controller;

use think\Controller;

class Admin extends Controller
{
    /**
     *
     */
    function _initialize (){
		if (!session('userInfo')){
			$this->error("请先登录",'/blog/index/login');
		}
	}
	
	public function index() {
        
		return $this->fetch();
	}

    public function logout() {
        session('userInfo',null);
        $this->success('退出成功！','/blog/index/login');
    }
}
